<template>
  <div class="app-container">
    <!-- 高级查询 -->
    <el-tabs v-model="queryParams.status" type="card" @tab-click="handleQuery">
    	<el-tab-pane name="created">
    		<span slot="label"><i class="el-icon-bank-card" />新计划</span>
    	</el-tab-pane>

    	<el-tab-pane name="planed">
    		<span slot="label"><i class="el-icon-bank-card" /> 已安排</span>
    	</el-tab-pane>
    	<el-tab-pane name="outed">
    		<span slot="label"><i class="el-icon-bank-card" /> 待发货</span>
    	</el-tab-pane>
    	<el-tab-pane name="shipPlaned">
    		<span slot="label"><i class="el-icon-bank-card" /> 已发货</span>
    	</el-tab-pane>
    </el-tabs>
   <el-form v-show="searchVisible" ref="queryForm" :model="queryParams" :inline="true">

     <el-form-item label="出库单号:">
        <el-input v-model="queryParams.orderNo" size="small" placeholder="请输入出库单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="仓库">

              <el-select v-model="queryParams.warehouseCode" filterable clearable placeholder="请选择">
              	<el-option v-for="item in  options.warehouseCodes" :key="item.id" :label="item.warehouserName"
              		:value="item.id">
              	</el-option>

              </el-select>
          </el-form-item>


    <!--  <el-form-item label="选择商品车：" prop="materialNo">
        <el-input v-model="queryParams.materialNo" class="filter-item" >
          <i slot="suffix" class="el-input__icon el-icon-search" @click="openMaterialSelector" />
        </el-input>
        <warehouse-customer-selector ref="warehouseCustomerSelector" :visible.sync="materialSelectorVisible" @selected="handleMaterialSelected" />
      </el-form-item> -->
     <!--  <el-form-item label="仓库编码:">
        <el-input v-model="queryParams.warehouseCode" size="small" placeholder="请输入仓库编码" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="客户号:">
        <el-input v-model="queryParams.customerNo" size="small" placeholder="请输入客户号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="域:">
        <el-input v-model="queryParams.siteCode" size="small" placeholder="请输入域" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="预出库时间:">
        <el-date-picker v-model="queryParams.preDeliveryTime" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择预出库时间" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-date-picker v-model="queryParams.createDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择" clearable />
      </el-form-item>
      <el-form-item label="审核人:">
        <el-input v-model="queryParams.approveBy" size="small" placeholder="请输入审核人" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="审核时间:">
        <el-date-picker v-model="queryParams.approveDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择审核时间" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.remark" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.version" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item> -->
     <!-- <el-form-item label="出库单号:">
        <el-input v-model="queryParams.deliveryNo" size="small" placeholder="请输入出库单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="模板号:">
        <el-input v-model="queryParams.templateId" size="small" placeholder="请输入模板号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="出库数:">
        <el-input v-model="queryParams.quantity" size="small" placeholder="请输入出库数" clearable @keyup.enter.native="handleQuery" />
      </el-form-item> -->
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 工具栏 -->
    <el-row :gutter="10" class="mb8">
     <!-- <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:insert']" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:update']" type="success" icon="el-icon-edit" size="mini" :disabled="isSingle" @click="handleEdit">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:delete']" type="danger" icon="el-icon-delete" size="mini" :disabled="isMultiple" @click="handleRemove">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:insert']" type="info" icon="el-icon-upload2" size="mini" @click="openUploadDialog">导入</el-button>
      </el-col> -->
    <!--  <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:insert']" type="info" icon="el-icon-upload2" size="mini" :disabled="isMultiple" @click="handlePickUP">生成拣货计划</el-button>
      </el-col> -->
      <!-- <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:insert']" type="info" icon="el-icon-upload2" size="mini"  @click="handleAutoPickUP">自动拣货计划</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button v-hasPermission="['web:tbWmsMaterialDelivery:export']" type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
      </el-col>
      <right-toolbar :show-search.sync="searchVisible" @queryTable="handleQuery" />
    </el-row>

    <!-- 数据列表 -->
    <el-table v-loading="loading" :data="page.records" highlight-current-row @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column type="expand">
        <template slot-scope="props" style="padding: 20px 50px;">
          <el-table v-loading="loading" :data="props.row.receitems" highlight-current-row>

            <el-table-column label="所在库位" align="center" prop="locationNo" width="150px" />
            <el-table-column label="品牌" align="center" prop="vehicleBrand" width="150px" />
            <el-table-column label="型号" align="center" prop="vehicleModel" width="150px" />
            <el-table-column label="要求发货时间" align="center" prop="previousDepartTime" width="150px" />
            <el-table-column label="要求到货时间" align="center" prop="requestDeliveryTime" width="150px" />
            <el-table-column label="到货地址" align="center" prop="deliveryWarehouseName" width="150px" />

          </el-table>
        </template>
      </el-table-column>
      <el-table-column label="出库单号" align="center" prop="orderNo" width="150px">
              <template slot-scope="scope">
                <a @click="toOrderDetail(scope.row.id)">{{ scope.row.orderNo }}</a>
              </template>
            </el-table-column>
    <!--  <el-table-column label="仓库编码" align="center" prop="warehouseCode" /> -->
      <!-- <el-table-column label="客户号" align="center" prop="consignee" width="250"/> -->
      <el-table-column label="客户名称" align="center" prop="consigneeName" width="150" />
      <el-table-column label="送达地址" align="center" prop="consigneeAddress" width="180" />

    <el-table-column label="送达地址" align="center" prop="orderTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="审核人" align="center" prop="approveBy" />
      <el-table-column label="审核时间" align="center" prop="approveDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="状态" align="center" width="90">
       <template slot-scope="scope">
          <span>{{ scope.row.status | statusFilter }}</span>
        </template>
      </el-table-column>
      <el-table-column label="单号" align="center" prop="caseNo" width="250"/>
      <!-- <el-table-column label="模板号" align="center" prop="templateId" />
 -->
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button v-hasPermission="['web:tbWmsMaterialDelivery:update']" size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
          <el-button v-hasPermission="['web:tbWmsMaterialDelivery:delete']" size="mini" type="text" icon="el-icon-delete" @click="handleRemove(scope.row)">删除</el-button>

        <el-button  size="small" type="primary"
        	icon="el-icon-plus" @click="handleView(scope.row)">详情
        </el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <pagination v-show="page.total>0" :total="page.total" :page.sync="page.current" :limit.sync="page.pageSize" @pagination="handleQuery" />
    <el-dialog :title="pickUpDialog.title" :visible.sync="pickUpDialog.visible" :close-on-click-modal="false" width="500px" append-to-body>
       <el-table v-loading="eloading" :data="employeePage.records" highlight-current-row @selection-change="handleEmployeeSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="" align="center" prop="personName" />
        <el-table-column label="" align="center" prop="userId" />
        <el-table-column label="" align="center" prop="userType" />
        <el-table-column label="" align="center" prop="enrollDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.enrollDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="" align="center" prop="currentJobLoad" />
        <el-table-column label="" align="center" prop="idCard" />
       </el-table>
      <pagination v-show="employeePage.total>0" :total="employeePage.total" :page.sync="employeePage.current" :limit.sync="employeePage.pageSize" @pagination="handleEmployeeQuery" />
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmPickUPDialog">确 定</el-button>
        <el-button @click="resetPickUPDialog">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 添加/修改对话框 -->
    <el-dialog :title="tbWmsMaterialDeliveryFormDialog.title" :visible.sync="tbWmsMaterialDeliveryFormDialog.visible" :close-on-click-modal="false" width="500px" append-to-body>
      <el-form ref="tbWmsMaterialDeliveryForm" :model="tbWmsMaterialDeliveryFormData" :rules="tbWmsMaterialDeliveryFormRules" label-width="80px">
        <el-form-item label="出库单号" prop="orderNo">
          <el-input v-model="tbWmsMaterialDeliveryFormData.orderNo" placeholder="请输入出库单号" />
        </el-form-item>
        <el-form-item label="仓库编码" prop="warehouseCode">
          <el-input v-model="tbWmsMaterialDeliveryFormData.warehouseCode" placeholder="请输入仓库编码" />
        </el-form-item>
        <el-form-item label="客户号" prop="customerNo">
          <el-input v-model="tbWmsMaterialDeliveryFormData.customerNo" placeholder="请输入客户号" />
        </el-form-item>
        <el-form-item label="域" prop="siteCode">
          <el-input v-model="tbWmsMaterialDeliveryFormData.siteCode" placeholder="请输入域" />
        </el-form-item>
        <el-form-item label="预出库时间" prop="preDeliveryTime">
          <el-date-picker v-model="tbWmsMaterialDeliveryFormData.preDeliveryTime" type="date" value-format="yyyy-MM-dd" size="small" style="width: 200px" placeholder="选择预出库时间" clearable />
        </el-form-item>
        <el-form-item label="" prop="createDate">
          <el-date-picker v-model="tbWmsMaterialDeliveryFormData.createDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 200px" placeholder="选择" clearable />
        </el-form-item>
        <el-form-item label="审核人" prop="approveBy">
          <el-input v-model="tbWmsMaterialDeliveryFormData.approveBy" placeholder="请输入审核人" />
        </el-form-item>
        <el-form-item label="审核时间" prop="approveDate">
          <el-date-picker v-model="tbWmsMaterialDeliveryFormData.approveDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 200px" placeholder="选择审核时间" clearable />
        </el-form-item>
        <el-form-item label="" prop="remark">
          <el-input v-model="tbWmsMaterialDeliveryFormData.remark" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="version">
          <el-input v-model="tbWmsMaterialDeliveryFormData.version" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="出库单号" prop="deliveryNo">
          <el-input v-model="tbWmsMaterialDeliveryFormData.deliveryNo" placeholder="请输入出库单号" />
        </el-form-item>
        <el-form-item label="模板号" prop="templateId">
          <el-input v-model="tbWmsMaterialDeliveryFormData.templateId" placeholder="请输入模板号" />
        </el-form-item>
        <el-form-item label="出库数" prop="quantity">
          <el-input v-model="tbWmsMaterialDeliveryFormData.quantity" placeholder="请输入出库数" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmTbWmsMaterialDeliveryFormDialog">确 定</el-button>
        <el-button @click="resetTbWmsMaterialDeliveryFormDialog">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 出库计划导入对话框 -->
    <el-dialog :title="uploadDialog.title" :visible.sync="uploadDialog.visible" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        :headers="uploadData.headers"
        :action="uploadData.url + '?isUpdateSupport=' + uploadData.isUpdateSupport"
        :disabled="uploadData.isUploading"
        :on-progress="handleUploadProgress"
        :on-success="handleUploadSuccess"
        :auto-upload="false"
        accept=".xlsx, .xls"
        drag
      >
        <i class="el-icon-upload" />
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div slot="tip" class="el-upload__tip">
          <el-link type="info" style="font-size:12px" @click="handleDownloadTemplate">下载模板</el-link>
        </div>
        <div slot="tip" class="el-upload__tip" style="color:red">提示：仅允许导入“xls”或“xlsx”格式文件！</div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmUploadDialog">确 定</el-button>
        <el-button @click="resetUploadDialog">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import TbWmsMaterialDeliveryApi from '@/api/web/TbWmsMaterialDeliveryApi'
import TWmsDeliveryPickupPlanApi  from '@/api/web/TWmsDeliveryPickupPlanApi'
import AuthUtils from '@/utils/AuthUtils'
import appConstant from '@/constant/AppConstant'
import HrEmployeeManageApi from '@/api/basic/HrEmployeeManageApi'
import WarehouseApi from '@/api/basic/WarehouseApi'
const defaultTbWmsMaterialDeliveryFormData = {
  orderNo: null,
  warehouseCode: null,
  customerNo: null,
  siteCode: null,
  preDeliveryTime: null,
  createDate: null,
  approveBy: null,
  approveDate: null,
  status: '0',
  version: null,
  deliveryNo: null,
  templateId: null,
  quantity: null,
}
export default {
  name: 'TbWmsMaterialDeliveryList',
  filters: {
    statusFilter(item) {
      const values = appConstant.warehouseDeliveryStatusList.filter(value => value.key === item)
      if (values && values.length > 0) {
        return values[0].label
      } else {
        return ''
      }
    }
   },
  data() {
    return {
      options: {
        sysYnTypeOptions: this.$constant.sysYnTypeOptions,
        warehouseCodes:[]

      },
      queryParams: {
        orderNo: null,
        warehouseCode: null,
        customerNo: null,
        siteCode: null,
        preDeliveryTime: null,
        createDate: null,
        approveBy: null,
        approveDate: null,
        status: 'created',
        remark: null,
        version: null,
        deliveryNo: null,
        templateId: null,
        quantity: null,
        isValid: this.$constant.Y
      },
      equeryParams: {
        personName: null
      },
      page: {
        current: 1,
        pageSize: 10,
        total: 0,
        records: []
      },
      employeePage: {
        current: 1,
        pageSize: 10,
        total: 0,
        records: []
      },
      tbWmsMaterialDeliveryFormDialog: {
        title: '',
        visible: false
      },
      pickUpDialog: {
        title: '拣货执行人员选择',
        visible: false
      },
      pickUpDialogData: {
        pickUpUserNo: null
      },
      tbWmsMaterialDeliveryFormData: Object.assign({}, defaultTbWmsMaterialDeliveryFormData),
      tbWmsMaterialDeliveryFormRules: {
        orderNo: [{ required: true, message: '出库单号不能为空', trigger: 'blur' }],
        createDate: [{ required: true, message: '不能为空', trigger: 'blur' }],
        status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
        version: [{ required: true, message: '不能为空', trigger: 'blur' }],
      },
      uploadDialog: {
        title: '出库计划导入',
        visible: false
      },
      uploadData: {
        headers: { Authorization: 'Bearer ' + AuthUtils.getToken() }, // 上传请求头
        url: process.env.VUE_APP_BASE_API + '/web/tbWmsMaterialDelivery/importData', // 上传的地址
        isUploading: false, // 是否禁用上传
        isUpdateSupport: 1 // 是否更新已经存在的数据
      },
      loading: true,
      dateRange: null,
      eloading: true,
      searchVisible: true,
      multipleSelection: [],
      employeeSelecMultipleSelection: [],
      isSingle: true,
      isMultiple: true
    }
  },
 created() {
   this.dateRange = this.$route.params.dateRange
   
   this.getOrders(this.dateRange )
   this.loadOptions()
 },
  methods: {
    loadOptions() {
         let that = this;
      WarehouseApi.list().then(response => {
        that.options.warehouseCodes = response.data
      })
    },
    getOrders(dateRange) {
      this.loading = true
      this.queryParams.dateRange = dateRange
      TbWmsMaterialDeliveryApi.page(this.queryParams, this.page).then(response => {
        this.page.records = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }, () => {
        this.loading = false
      })
    },

    toOrderDetail(orderId) {
      this.$router.push({
        path: '/tbWmsMaterialDelivery/tbWmsMaterialDeliveryView/' + orderId
      })
    },
    handleAdd() {
      this.openTbWmsMaterialDeliveryFormDialog()
    },
    handleRemove(row) {
      const ids = row.id || this.multipleSelection.map(item => item.id)
      this.$confirm('是否确认删除数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return TbWmsMaterialDeliveryApi.remove(ids)
      }).then(() => {
        this.handleQuery()
        this.$message.success('删除成功')
      })
    },
    handleView(row) {
    	this.$router.push({
    		path: `/tbWmsMaterialDelivery/view/${row.id}`
    	})
    },
    handleAutoPickUP(){
      TWmsDeliveryPickupPlanApi.pickUpPlan().then(response => {
        this.$message.success('拣货计划生成成功')
        this.handleQuery()
      })
    },
    handlePickUP(row) {
      const id = row.id || this.multipleSelection.map(item => item.id)[0]
      this.openPickUPDialog(id)
    },
    openPickUPDialog(id) {
      this.pickUpDialog.visible = true
    },
    confirmPickUPDialog() {
      const params = {
        materialDeliveryIds: this.multipleSelection.map(item => item.id)[0],
        employeeIds: this.employeeSelecMultipleSelection.map(item => item.id)[0]
      }
      console.log(params)
      this.resetPickUPDialog()
    },
    resetPickUPDialog() {
      this.pickUpDialog.visible = false
    },
    handleEdit(row) {
      const id = row.id || this.multipleSelection.map(item => item.id)[0]
      this.openTbWmsMaterialDeliveryFormDialog(id)
    },
    handleEmployeeQuery() {
      this.eloading = true
      HrEmployeeManageApi.page(this.equeryParams, this.employeePage).then(response => {
        this.employeePage.records = response.data.records
        this.employeePage.total = response.data.total
        this.eloading = false
      }, () => {
        this.eloading = false
      })
    },
    handleInitQuery() {
      this.loading = true
      this.queryParams.status = 'created'
      TbWmsMaterialDeliveryApi.page(this.queryParams, this.page).then(response => {
        this.page.records = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }, () => {
        this.loading = false
      })
    },
    handleQuery() {
      this.loading = true
      TbWmsMaterialDeliveryApi.page(this.queryParams, this.page).then(response => {
        this.page.records = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }, () => {
        this.loading = false
      })
    },
    handleExport() {
      this.$confirm('是否确认导出数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return TbWmsMaterialDeliveryApi.exportData(this.queryParams)
      }).then(response => {
        this.$common.download(response.msg)
      })
    },
    openTbWmsMaterialDeliveryFormDialog(id) {
      this.resetTbWmsMaterialDeliveryFormDialog()
      this.tbWmsMaterialDeliveryFormDialog.visible = true
      if (id) {
        this.tbWmsMaterialDeliveryFormDialog.title = '出库单-修改'
        TbWmsMaterialDeliveryApi.get(id).then(response => {
          this.tbWmsMaterialDeliveryFormData = {
            ...this.tbWmsMaterialDeliveryFormData,
            ...response.data
          }
        })
      } else {
        this.tbWmsMaterialDeliveryFormDialog.title = '出库单-添加'
      }
    },
    confirmTbWmsMaterialDeliveryFormDialog() {
      this.$refs['tbWmsMaterialDeliveryForm'].validate(valid => {
        if (valid) {
          if (this.tbWmsMaterialDeliveryFormData.id) {
            TbWmsMaterialDeliveryApi.edit(this.tbWmsMaterialDeliveryFormData).then(response => {
              this.$message.success('修改成功')
              this.tbWmsMaterialDeliveryFormDialog.visible = false
              this.handleQuery()
            })
          } else {
            TbWmsMaterialDeliveryApi.add(this.tbWmsMaterialDeliveryFormData).then(response => {
              this.$message.success('添加成功')
              this.tbWmsMaterialDeliveryFormDialog.visible = false
              this.handleQuery()
            })
          }
        }
      })
    },
    resetTbWmsMaterialDeliveryFormDialog() {
      this.tbWmsMaterialDeliveryFormDialog = {
        title: '',
        visible: false
      }
      this.tbWmsMaterialDeliveryFormData = Object.assign({}, defaultTbWmsMaterialDeliveryFormData)
      this.resetForm('tbWmsMaterialDeliveryForm')
    },
    openUploadDialog() {
      this.resetUploadDialog()
      this.uploadDialog.visible = true
    },
    confirmUploadDialog() {
      this.$refs.upload.submit()
    },
    resetUploadDialog() {
      this.uploadDialog.visible = false
    },
    handleDownloadTemplate() {
      TbWmsMaterialDeliveryApi.importTemplate().then(response => {
        this.$common.download(response.data)
      })
    },
    // 文件上传中处理
    handleUploadProgress(event, file, fileList) {
      this.uploadData.isUploading = true
    },
    // 文件上传成功处理
    handleUploadSuccess(response, file, fileList) {
      this.uploadDialog.visible = false
      this.uploadData.isUploading = false
      this.$refs.upload.clearFiles()
      this.$alert(response.data ? response.data : response.msg, '导入结果', { dangerouslyUseHTMLString: true })
      this.handleQuery()
    },
    handleSelectionChange(selection) {
      this.multipleSelection = selection
      this.isSingle = selection.length !== 1
      this.isMultiple = !selection.length
    },
    handleEmployeeSelectionChange(selection) {
      this.employeeSelecMultipleSelection = selection
    },
    resetQuery() {
      this.page.current = 1
      this.resetForm('queryForm')
      this.handleQuery()
    }
  }
}
</script>
